-
Notifications
You must be signed in to change notification settings - Fork 224
Do not delete e2e test resources on PR builds #227
Conversation
e3cea50
to
dcd3401
Compare
6bca383
to
2f862e5
Compare
2f862e5
to
372147a
Compare
@@ -29,7 +29,7 @@ internal class Parameters | |||
'd', | |||
"DevicePrefix", | |||
Required = false, | |||
Default = "RegistryManagerSample-", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing to match prefix style used. This was not in the delete list earlier but the sample deletes the device so this is just to guard against leaked resources. Currently the hub does not have any devices with this prefix so we don't need to worry about deleting the ones with old prefix.
@@ -65,8 +69,29 @@ private async Task CleanupDevices() | |||
excludeKeysInExport: true, | |||
storageAuthenticationType: StorageAuthenticationType.KeyBased); | |||
|
|||
JobProperties exportAllDevicesJob = await _registryManager.ExportDevicesAsync(exportAllDevicesProperties); | |||
JobProperties exportAllDevicesJob = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding retries on jobs to protect against any currently running job. We could change the total wait time if necessary after observing for a while.
372147a
to
37a4814
Compare
@@ -53,6 +53,10 @@ jobs: | |||
IOTHUB_PFX_X509_THUMBPRINT: $(IOTHUB-PFX-X509-THUMBPRINT) | |||
DPS_IDSCOPE: $(DPS-IDSCOPE) | |||
PROVISIONING_CONNECTION_STRING: $(PROVISIONING-CONNECTION-STRING) | |||
# PATH-TO-DEVICE-PREFIX-FOR-DELETION-FILE is a variable configured on the pipeline. The possible values are: csharp_devices_list.csv, csharp_samples_devices_list.csv. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is no longer a constant and no longer extracted from keyvault.
https://github.com/Azure/azure-iot-sdk-csharp/pull/2153/files
iot-hub/Samples/service/CleanupDevicesSample/CleanupDevicesSample.cs
Outdated
Show resolved
Hide resolved
37a4814
to
15411c1
Compare
15411c1
to
b768e2d
Compare
* Do not delete e2e test resources on PR builds (#227) * Remove barustum from CODEOWNERS (#224) Co-authored-by: Basel Rustum <[email protected]>
This PR mainly moves the configuration of which devices to delete to the pipeline variable rather than a constant value. Once this is checked in, the scheduled run will run as normal, running all tests and cleaning up both e2e and sample created devices.
Apart from that pipeline, I"ll add a new pipeline that will only delete the sample created devices along with running the samples. This pipeline will be enabled on PR builds.
After this is complete, I will make merge these changes to preview branch and create a PR pipeline for the preview branch as well.